package dao;

import javax.ejb.Stateless;
import javax.persistence.TypedQuery;

import entity.DiscountCategory;

@JPA
@Stateless
public class JPADiscountCategoryDAO extends GenericJPADAO<DiscountCategory> implements DiscountCategoryDAO {
	
	@Override
	public DiscountCategory selectDiscountCategoryByName(String name) {
		TypedQuery<DiscountCategory> query = em.createNamedQuery("DiscountCategory.selectByName", DiscountCategory.class).setParameter("name", name);
		DiscountCategory res = query.getSingleResult();
		return res;
	}
	
}